<%@page import="com.wodwl.configuration.ResourceConfiguration"%>
<%@page import="com.wodwl.entity.Resource"%>
<%@page import="com.wodwl.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@include file="../templete/header.jsp" %>
	<script type="text/javascript" src="../../static/ckeditor/ckeditor.js"></script>
	<style type="text/css">
		#copysvn{
			color: green;
		}
		a{
			font-size: x-small;
			color: green;
		}
	</style>
	<script type="text/javascript">
		function copysvn(){
			var str=document.getElementById("svn").innerHTML;
			 clipboardData.setData("text",str);
			 alert("svn地址复制成功");
		
		}
	</script>
</head>
<body >
<%
	pageContext.setAttribute("linkType","5");
%>
<%@include file="../templete/user_info.jsp"  %>
	<%
		Resource resource = (Resource) request.getAttribute("resource");
	%>


		


		<div class="conR">
			<div class="conR-hd">
				<h3>
					<%=resource.getName()%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<%
						if(resource.getOwner().equals(user.getUsername())){
					%>
						<a href="/resource/resource_editor1.do?rid=<%=resource.getRid()%>">编辑</a>
					<%
						}
					%>
				</h3>
			</div>

			<div class="oauth-sum-list">
				<div class="oauth-sum-listinfo">
					<ul>
						<li> 
							<%
 								String ext=resource.getStore_relative_path();
 															ext=ext.substring(ext.lastIndexOf(".")+1);
 															String fileType="";
 															if(ext.equals("doc")||ext.equals("docx")){
 																fileType="word";
 															}else if(ext.equals("xls")||ext.equals("xlsx")){
 																fileType="excel";
 															}else if(ext.equals("ppt")||ext.equals("pptx")){
 																fileType="ppt";
 															}else if(ext.equals("txt")){
 																fileType="txt";
 															}else if(ext.equals("war")){
 																fileType="war";
 															}else if(ext.equals("mp3")){
 																fileType="music";
 															}else if(ext.equals("jpg")||ext.equals("png")){
 																fileType="pic";
 															}else if(ext.equals("wmv")){
 																fileType="movie";
 															}else{
 																fileType="other";
 															}
 							%>
									<a href="/resource/resource_show.do?rid=<%=resource.getRid()%>">
										<img id="img_type" src="/img/file_type/<%=fileType%>.png" >
									 </a>
						</li>
						<li>资源名称：<%=resource.getName()%></li>
						<li>资源大小：<%=resource.getSize()%></li>
						<li>资源类型：

						<%
							switch(resource.getType()){
													 case 1:
						%>
									 程序文档 
									 <%
							break;
													 case 2:
						%>
									 小论文
									 <%
							break;
													 case 3:
						%>
									 答辩资料
									 <%
							break;
													 case 4:
						%>
									 音乐
									 <%
							break;
													 case 5:
						%>
									 影视
									 <%
							break;
													 case 6:
						%>
									 其它
									 <%
							}
						%></li>
						<li>上传者：<%=resource.getOwner()%></li>
						<li>上传时间：<%=resource.getCreate_time()%></li>
						
						<li><a href="<%=ResourceConfiguration.resource_downloadPath%><%=resource.getStore_relative_path()%>">下载</a></li>
						
					</ul>
				</div>
			</div>
		</div>

		<jsp:include page="../templete/footer.jsp"></jsp:include>
</body>
</html>